xen.git
18 years agoxend: Remove duplicate setResume() method.
Keir Fraser [Thu, 28 Feb 2008 10:31:45 +0000 (10:31 +0000)]
xend: Remove duplicate setResume() method.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
18 years agoFix error message of xm suspend and xm resume for Domain-0.
Keir Fraser [Thu, 28 Feb 2008 10:30:21 +0000 (10:30 +0000)]
Fix error message of xm suspend and xm resume for Domain-0.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
18 years agoioemu: Send logs to stderr and have xend redirect stderr to the
Keir Fraser [Thu, 28 Feb 2008 10:29:25 +0000 (10:29 +0000)]
ioemu: Send logs to stderr and have xend redirect stderr to the
correct log file.

At the same time, this patch renames the logfile to be
'qemu-dm-{NAME}.log' instead of qemu-dm-{ID}.log.  This makes it
easier to track/find the QEMU logfile associated with a VM. It will
also save 1 backup qemu-dm-{NAME}.log.1 so if a domain crashes &
restart, you don't loose/overwrite the logfile immediately.

Finally it changes the QEMU monitor prompt back to '(qemu)' instead of
'(HVMXen)' because automated tools /scripts interacting with QEMU's
monitor need a consistent prompt to look for & changing it for Xen
serves no useful purpose.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
18 years agostubdom: use PVFB so as to e.g. permit SDL display
Keir Fraser [Thu, 28 Feb 2008 10:21:21 +0000 (10:21 +0000)]
stubdom: use PVFB so as to e.g. permit SDL display

This adds support in ioemu for PVFB frontend as stubdomain display.
This permits for instance to use SDL in dom0 to perform the eventual
display.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
18 years agoFix non-portability in xentrace
Keir Fraser [Thu, 28 Feb 2008 10:19:49 +0000 (10:19 +0000)]
Fix non-portability in xentrace

Replace statfs() with the equivalent statvfs(), and correct the block
size multiplier.

Signed-off-by: John Levon <john.levon@sun.com>
18 years agoioemu: Expandable storage backends should defeat block-device range checks.
Keir Fraser [Wed, 27 Feb 2008 13:21:36 +0000 (13:21 +0000)]
ioemu: Expandable storage backends should defeat block-device range checks.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
18 years agoFix xm save command's #params check.
Keir Fraser [Wed, 27 Feb 2008 13:19:42 +0000 (13:19 +0000)]
Fix xm save command's #params check.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
18 years agoxend: Set default vcpu affinity for better performance in NUMA systems.
Keir Fraser [Wed, 27 Feb 2008 13:17:49 +0000 (13:17 +0000)]
xend: Set default vcpu affinity for better performance in NUMA systems.
Signed-off-by: Duan Ronghui <ronghui.duan@intel.com>
18 years agoioemu: Fix e1000 mmio range size.
Keir Fraser [Wed, 27 Feb 2008 13:16:02 +0000 (13:16 +0000)]
ioemu: Fix e1000 mmio range size.

Per Intel 82540EM Software Developer's Manual pp. 211, the mmio size
is 0x20000, or address overlapping occurs and causes the second card
to fail, which happened to me earlier.

From: Tina Yang <tina.yang@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agominios: have xenbus_printf return the error returned by xenbus_write
Keir Fraser [Wed, 27 Feb 2008 13:11:33 +0000 (13:11 +0000)]
minios: have xenbus_printf return the error returned by xenbus_write
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
18 years agoFix libxenstat on Solaris
Keir Fraser [Wed, 27 Feb 2008 13:10:42 +0000 (13:10 +0000)]
Fix libxenstat on Solaris

Recent Solaris enhancements have changed the way virtual NIC
statistics are collected - fix libxenstat up for this.

Signed-off-by: John Levon <john.levon@sun.com>
18 years agostubdom: log and documentation fixes
Keir Fraser [Tue, 26 Feb 2008 15:11:51 +0000 (15:11 +0000)]
stubdom: log and documentation fixes

- Document that for vnclisten names and 127.0.0.1 should not be used.
- Documentation cosmetic fixes
- Dump qemu output to the usual logs

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
18 years agostubdom: fix x86_32 compilation by __moddi3 from FreeBSD
Keir Fraser [Tue, 26 Feb 2008 15:11:07 +0000 (15:11 +0000)]
stubdom: fix x86_32 compilation by __moddi3 from FreeBSD
(like has been done previously for umoddi3 etc.)

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
18 years agoFix xm mem-max command to restore previous setting if xc.domain_setmaxmem fails.
Keir Fraser [Tue, 26 Feb 2008 15:02:26 +0000 (15:02 +0000)]
Fix xm mem-max command to restore previous setting if xc.domain_setmaxmem fails.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
18 years agoxend: Add free memory size of every node in physinfo to help user to
Keir Fraser [Tue, 26 Feb 2008 15:00:08 +0000 (15:00 +0000)]
xend: Add free memory size of every node in physinfo to help user to
get usage of memory of their NUMA machine.

Signed-off-by: Duan Ronghui <ronghui.duan@intel.com>
18 years agoioemu: VNC updates should be sent only when requested.
Keir Fraser [Tue, 26 Feb 2008 14:50:45 +0000 (14:50 +0000)]
ioemu: VNC updates should be sent only when requested.

Reading qemu code I realized that the qemu vnc server sometimes sends
framebuffer updates even if the client didn't request any. This is not
consistent with the RFB protocol spec and can break some clients.
This patch strictly enforces compliance with the RFB protocol making
sure framebuffer updates are sent only if the client requested one.
Doing so is more difficult than it seems because some framebuffer
pseudo-encoding updates cannot be discarded but must be sent anyway:
for example desktop resize and pixel format change messages. To solve
the problem I wrote a queue that stores those messages and sends them
as soon as the client asks for an update. Since 90% of the times the
queue is used to store only few elements, the queue allocates 10
elements at the beginning and every time it runs out of elements
allocates other 10 elements. This is should drastically limit the
number of malloc and free needed to maintain the queue. I did some
stress tests in the last couple of days and seems to work well.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
18 years agominios: add PVFB support
Keir Fraser [Tue, 26 Feb 2008 14:47:23 +0000 (14:47 +0000)]
minios: add PVFB support
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
18 years agoioemu: Do not sue xce_handle directly as a file descriptor.
Keir Fraser [Tue, 26 Feb 2008 14:46:57 +0000 (14:46 +0000)]
ioemu: Do not sue xce_handle directly as a file descriptor.

xce handles are not supposed to be used as file descriptors, but
xc_evtchn_fd() be used.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
18 years agox86_emulate: Fix FNSTCW/FNSTSW modrm range check.
Keir Fraser [Tue, 26 Feb 2008 14:46:07 +0000 (14:46 +0000)]
x86_emulate: Fix FNSTCW/FNSTSW modrm range check.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
18 years agox86 hvm: Fix bugzilla bug 1172.
Keir Fraser [Tue, 26 Feb 2008 14:40:44 +0000 (14:40 +0000)]
x86 hvm: Fix bugzilla bug 1172.

Bug 1172 is caused by missing a type cast from mfn_t to paddr_t, when
in pae mode and hsot memory is larger than 4G.

Signed-off-by: Disheng Su <disheng.su@intel.com>
18 years agoxentrace: Add a time parameter
Keir Fraser [Tue, 26 Feb 2008 14:39:26 +0000 (14:39 +0000)]
xentrace: Add a time parameter
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
18 years agoxentrace: Disable tracing by default on exit
Keir Fraser [Tue, 26 Feb 2008 14:39:11 +0000 (14:39 +0000)]
xentrace: Disable tracing by default on exit
Includes an option to disable this behavior.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
18 years agoxentrace: Add option to reserve disk space
Keir Fraser [Tue, 26 Feb 2008 14:38:57 +0000 (14:38 +0000)]
xentrace: Add option to reserve disk space
Before writing records, xentrace will check to make sure that there is
a minimum amount of space left on the output filesystem.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
18 years agoxentrace: Fix --discard-buffers option
Keir Fraser [Tue, 26 Feb 2008 14:38:39 +0000 (14:38 +0000)]
xentrace: Fix --discard-buffers option
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
18 years agoioemu: e1000 emulation
Keir Fraser [Tue, 26 Feb 2008 14:37:44 +0000 (14:37 +0000)]
ioemu: e1000 emulation

This is a direct port of the e1000 driver currently in Qemu CVS with
extremely minimal changes.  This is useful for Xen as new OSes may not
support the old 100Mbps NICs we currently support (especially on
non-x86).  Drivers for e1000 should be more readily available.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
18 years agoFix restore of saved image containing rtc_timeoffset
Keir Fraser [Tue, 26 Feb 2008 14:35:39 +0000 (14:35 +0000)]
Fix restore of saved image containing rtc_timeoffset

Saved images contain rtc_timeoffset as a string value, resulting in a
TypeError exception when calling xc.domain_set_time_offset() on
restore.  Cast rtc_timeoffset to int before calling
xc.domain_set_time_offset().

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
18 years agovtpm: script function for identifying vTPM by its UUID
Keir Fraser [Tue, 26 Feb 2008 14:34:50 +0000 (14:34 +0000)]
vtpm: script function for identifying vTPM by its UUID

I am adding some functions for external tools to call the vTPM scripts.
It also contains a fix for the functions that previously used to be
called by domain name, but now are using the vTPM's uuid as parameter.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
18 years agostubdom: Disable PCI passthrough functionality for now.
Keir Fraser [Mon, 25 Feb 2008 16:34:49 +0000 (16:34 +0000)]
stubdom: Disable PCI passthrough functionality for now.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
18 years agox86: Foreign mappings of HVM-guest pages should not affect type count,
Keir Fraser [Mon, 25 Feb 2008 11:24:06 +0000 (11:24 +0000)]
x86: Foreign mappings of HVM-guest pages should not affect type count,
even when the mapping is made via a grant reference.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agohvmloader/acpi: Simplify Processor Object definitions.
Keir Fraser [Mon, 25 Feb 2008 10:56:23 +0000 (10:56 +0000)]
hvmloader/acpi: Simplify Processor Object definitions.

No need to generate the correct number dynamically since
present/not-present can be determined from the MADT. What *is*
required is that we have a Processor Object for every present
processor. We statically declare 16 Objects, which should be plenty
for now.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agoxenoprof: Fix x86 32-on-64 xenoprof_arch_counter() implementation.
Keir Fraser [Mon, 25 Feb 2008 09:18:20 +0000 (09:18 +0000)]
xenoprof: Fix x86 32-on-64 xenoprof_arch_counter() implementation.
From: George Dunlap <George.Dunlap@eu.citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agoblktap: Remove some code duplication
Keir Fraser [Mon, 25 Feb 2008 09:12:20 +0000 (09:12 +0000)]
blktap: Remove some code duplication

With my qcow2 patch to blktap I contributed a bit to the mess, so here
an attempt to clean up and remove at least some of the code
duplication in the functions dealing with aio operations.

Signed-off-by: Kevin Wolf <kwolf@suse.de>
18 years agoioemu: Fix Solaris build.
Keir Fraser [Mon, 25 Feb 2008 09:09:01 +0000 (09:09 +0000)]
ioemu: Fix Solaris build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agosvm: Fix stupid typo in svm_set_interrupt_shadow().
Keir Fraser [Mon, 25 Feb 2008 09:07:24 +0000 (09:07 +0000)]
svm: Fix stupid typo in svm_set_interrupt_shadow().
Signed-off-by: Christoph Egger <christoph.egger@amd.com>
svm: Also return STI *and* MOV-SS blocking from
svm_get_interrupt_shadow().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agohvm: More emulation changes: push some of the realmode or HVM-emulate
Keir Fraser [Fri, 22 Feb 2008 18:32:41 +0000 (18:32 +0000)]
hvm: More emulation changes: push some of the realmode or HVM-emulate
specific stuff into core x86_emulate().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agoxen: Add license stanza to a few public headers.
Keir Fraser [Fri, 22 Feb 2008 16:49:56 +0000 (16:49 +0000)]
xen: Add license stanza to a few public headers.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agox86 hvm: More emulation simplifications.
Keir Fraser [Fri, 22 Feb 2008 10:52:27 +0000 (10:52 +0000)]
x86 hvm: More emulation simplifications.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agoNew Xenbus states Reconfiguring and Reconfigured.
Keir Fraser [Fri, 22 Feb 2008 10:07:35 +0000 (10:07 +0000)]
New Xenbus states Reconfiguring and Reconfigured.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
18 years agohvm: Remove lots of custom trap-and-emulate code and defer to
Keir Fraser [Thu, 21 Feb 2008 18:02:42 +0000 (18:02 +0000)]
hvm: Remove lots of custom trap-and-emulate code and defer to
handle_mmio()->hvm_emulate_one()->x86_emulate().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agoMove vtd and amd iommu code to arch-generic location.
Keir Fraser [Thu, 21 Feb 2008 15:06:37 +0000 (15:06 +0000)]
Move vtd and amd iommu code to arch-generic location.
Signed-off-by: Weidong Han <weidong.han@intel.com>
18 years agox86_emulate: Allow writeback-avoidance optimisation to be defeated by
Keir Fraser [Thu, 21 Feb 2008 14:50:27 +0000 (14:50 +0000)]
x86_emulate: Allow writeback-avoidance optimisation to be defeated by
the caller. This is used in cases where the writeback may be to an
MMIO region with side effects (the APIC EOI register is the main
example of this).

Also fix up build of the x86_emulate user-space test harness.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agoblktap: qcow2 image format support
Keir Fraser [Thu, 21 Feb 2008 10:30:57 +0000 (10:30 +0000)]
blktap: qcow2 image format support

This patch adds support for the qcow2 image format to blktap. It
consists mostly of qemu code, adapted to the blktap interfaces.
Snapshots and compressed images are supported.

The qcow2 driver may be used by either specifying tap:qcow2 or by
using tap:qcow which will detect that you have a version 2 image and
will call the qcow2 driver.

Signed-off-by: Kevin Wolf <kwolf@suse.de>
18 years agox86/64: Fix PAE-on-64 mmuext_op() preemption.
Keir Fraser [Wed, 20 Feb 2008 18:18:03 +0000 (18:18 +0000)]
x86/64: Fix PAE-on-64 mmuext_op() preemption.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agoxenconsoled: don't force newline with timestamps
Keir Fraser [Wed, 20 Feb 2008 18:00:28 +0000 (18:00 +0000)]
xenconsoled: don't force newline with timestamps

Previously a newline was forced after every call to
write_with_timestamp. This could result in some ugly logs when a
single console line stretched over multiple calls. This change carries
some extra state to determine if we ended the last call to
write_with_timestamp on a newline, and prints the timestamp as
appropriate.

This also fixes a bug where logging hv messages was dependent on the
guest timestamp flag.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
18 years agoioemu: Share framebuffer between VGA device model and VNC server.
Keir Fraser [Wed, 20 Feb 2008 17:47:58 +0000 (17:47 +0000)]
ioemu: Share framebuffer between VGA device model and VNC server.

Now that the qemu WMVi patch is applied we can take full advantage of
it sharing the video buffer between the vga driver and the qemu vnc
server. This saves a lot of memcpy. It's worth mentioning again that
when the guest colour depth is 24 bit we cannot share the buffer
because 24 bpp is not supported by the vnc protocol, so we still have
to do the translation 24 bpp -> 32 bpp.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
18 years agoioemu: Do proper block device extent checks.
Keir Fraser [Wed, 20 Feb 2008 17:46:10 +0000 (17:46 +0000)]
ioemu: Do proper block device extent checks.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
18 years agoxm: Fix xm vcpu-pin to complain for CPU numbers out of range.
Keir Fraser [Wed, 20 Feb 2008 17:42:12 +0000 (17:42 +0000)]
xm: Fix xm vcpu-pin to complain for CPU numbers out of range.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
18 years agox86 shadow: Minor fix to the fast emulation patch.
Keir Fraser [Wed, 20 Feb 2008 17:38:19 +0000 (17:38 +0000)]
x86 shadow: Minor fix to the fast emulation patch.

The fast emulation path patch introduced a bug when we have an event
injection during a write to a pagetable: after removing shadows we
still jump to the done label, releasing the lock even if we aren't
grabbing it.

Signed-off-by: Gianluca Guida <gianluca.guida@eu.citrix.com>
18 years agox86 hvm: Replace old MMIO emulator with x86_emulate()-based harness.
Keir Fraser [Wed, 20 Feb 2008 14:36:45 +0000 (14:36 +0000)]
x86 hvm: Replace old MMIO emulator with x86_emulate()-based harness.
Re-factor VMX real-mode emulation to use the same harness.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agomerge with xen-unstable.hg
Alex Williamson [Tue, 19 Feb 2008 18:14:40 +0000 (11:14 -0700)]
merge with xen-unstable.hg

18 years ago[IA64] Fix getvcpucontext hypercall
Alex Williamson [Tue, 19 Feb 2008 16:28:09 +0000 (09:28 -0700)]
[IA64] Fix getvcpucontext hypercall

NaT bits for r1-r31 from xc_vcpu_getcontext() are broken.
HVM domain is confused by unknown Nat consumption fault
after domain restore or migration.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
18 years ago[IA64] Fix shadow_op_off hypercall
Alex Williamson [Tue, 19 Feb 2008 16:26:39 +0000 (09:26 -0700)]
[IA64] Fix shadow_op_off hypercall

A domain might panic with unknown dirty bit fault
in case of live-migration failure.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
18 years ago[IA64] Avoid wild use of registers.
Alex Williamson [Tue, 19 Feb 2008 16:25:22 +0000 (09:25 -0700)]
[IA64] Avoid wild use of registers.

This patch avoids wild use of registers (r9,p6,p7) in guest_vhpt_lookup.

Signed-off-by: Tristan Gingold <tgingold@free.fr>
18 years ago[IA64] Handle long vhpt format for ttag and thash.
Alex Williamson [Tue, 19 Feb 2008 16:22:25 +0000 (09:22 -0700)]
[IA64] Handle long vhpt format for ttag and thash.

Improve tak emulation.

Signed-off-by: Tristan Gingold <tgingold@free.fr>
18 years ago[IA64] Self IO EMUlator - tools part
Alex Williamson [Tue, 19 Feb 2008 15:12:28 +0000 (08:12 -0700)]
[IA64] Self IO EMUlator - tools part

Signed-off-by: Tristan Gingold <tgingold@free.fr>
18 years ago[IA64] Self IO EMUlator (sioemu) - Hypervisor part
Alex Williamson [Tue, 19 Feb 2008 15:11:22 +0000 (08:11 -0700)]
[IA64] Self IO EMUlator (sioemu) - Hypervisor part

Implements Self IO-EMUlator.  It's an hybrid domain: looks
like PV from an external point of view but runs with VTI enabled.

All MMIO/IO writes/reads are reflected to the firmware, which converts the
access to PV drivers requests.

Signed-off-by: Tristan Gingold <tgingold@free.fr>
18 years ago[IA64] Build warning fix
Alex Williamson [Tue, 19 Feb 2008 14:51:25 +0000 (07:51 -0700)]
[IA64] Build warning fix

Signed-off-by: Tristan Gingold <tgingold@free.fr>
18 years agohvm: Better gating of hvm_get_segment_register() in __hvm_copy().
Keir Fraser [Mon, 18 Feb 2008 21:26:57 +0000 (21:26 +0000)]
hvm: Better gating of hvm_get_segment_register() in __hvm_copy().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agox86: Fix mod_l3_entry() for PAE-on-64 guests. The adjustment of
Keir Fraser [Mon, 18 Feb 2008 13:50:25 +0000 (13:50 +0000)]
x86: Fix mod_l3_entry() for PAE-on-64 guests. The adjustment of
_PAGE_RW and _PAGE_USER cannot happen before get_page_from_l3e().

Original patch by Manuel Bouyer <bouyer@netbsd.org>.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agoia64: Fix build after PCI hotplug changes.
Keir Fraser [Mon, 18 Feb 2008 09:35:39 +0000 (09:35 +0000)]
ia64: Fix build after PCI hotplug changes.
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
18 years agoamd iommu: Allow device deassignment.
Keir Fraser [Mon, 18 Feb 2008 09:33:40 +0000 (09:33 +0000)]
amd iommu: Allow device deassignment.
Signed-off-by: Wei Wang <wei.wang2@amd.com>
18 years ago[IA64] Handle nested dtlb miss in vmx_dirty_bit
Alex Williamson [Fri, 15 Feb 2008 17:34:00 +0000 (10:34 -0700)]
[IA64] Handle nested dtlb miss in vmx_dirty_bit

Although I believe that tpa in vmx_dirty_bit never generate
a nested dtlb miss, this patch ensures the fault case.

Confirmed the additional code in this patch works fine
by means of a debugger.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
18 years agoioemu: Fix the build.
Keir Fraser [Fri, 15 Feb 2008 14:31:20 +0000 (14:31 +0000)]
ioemu: Fix the build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agox86: Fix debug build.
Keir Fraser [Fri, 15 Feb 2008 14:16:42 +0000 (14:16 +0000)]
x86: Fix debug build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agoEnable HVM guest VT-d device hotplug via a simple ACPI hotplug device model.
Keir Fraser [Fri, 15 Feb 2008 14:13:17 +0000 (14:13 +0000)]
Enable HVM guest VT-d device hotplug via a simple ACPI hotplug device model.

** Currently only 2 virtual hotplug pci slots(6~7) are created so more
   than 2 vtd dev can't be hotplugged, but we can easily extend it in
   future.

Three new commands are added:
"xm pci-list domid" show the current assigned vtd device, like:
VSlt  domain   bus   slot   func
0x6      0x0  0x02   0x00    0x0

"xm pci-detach" hot remove the specified vtd device by the virtual
slot, like:
xm pci-detach EdwinHVMDomainVtd 6

"xm pci-attach DomainID dom bus dev func [vslot]" hot add a new vtd
device in the vslot. If no vslot specified, a free slot will be picked
up. e.g. to insert '0000:03:00.0':
xm pci-attach EdwinHVMDomainVtd 0 3 0 0

** guest pci hotplug
linux: pls. use 2.6.X and enable ACPI PCI hotplug ( Bus options=> PCI
hotplug => ACPI PCI hotplug driver )
windows: 2000/xp/2003/vista are all okay

Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
18 years agohvm acpi: Expose \_S4 ACPI object, allowing suspend-to-disk.
Keir Fraser [Fri, 15 Feb 2008 12:50:55 +0000 (12:50 +0000)]
hvm acpi: Expose \_S4 ACPI object, allowing suspend-to-disk.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agoProvide fast write emulation path to release shadow lock.
Keir Fraser [Fri, 15 Feb 2008 12:33:11 +0000 (12:33 +0000)]
Provide fast write emulation path to release shadow lock.

Basically we can consider shadow fault logic into two parts,
with 1st part to cover logistic work like validating guest
page table or fix shadow table, and the 2nd part for write
emulation.

However there's one scenario we can optimize to skip the
1st part. For previous successfully emulated virtual frame,
it's very likely approaching at write emulation logic again
if next adjacent shadow fault is hitting same virtual frame.
It's wasteful to re-walk 1st part which is already covered
by last shadow fault. In this case, actually we can jump to
emulation code early, without any lock acquisition until
final shadow validation for write emulation. By perfc counts
on 64bit SMP HVM guest, 89% of total shadow write emulation
are observed falling into this fast path when doing kernel
build in guest.

Signed-off-by Kevin Tian <kevin.tian@intel.com>

18 years agovt-d: Fix dom0 boot issue with vtd=1 on Stoakley platform. Turn off
Keir Fraser [Fri, 15 Feb 2008 09:54:28 +0000 (09:54 +0000)]
vt-d: Fix dom0 boot issue with vtd=1 on Stoakley platform.  Turn off
excessive messages.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
18 years agoxenconsoled: Use ISO8601 date stamp format.
Keir Fraser [Fri, 15 Feb 2008 09:51:34 +0000 (09:51 +0000)]
xenconsoled: Use ISO8601 date stamp format.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
18 years ago[IA64] Make translate_phy_pte() static
Alex Williamson [Thu, 14 Feb 2008 19:37:15 +0000 (12:37 -0700)]
[IA64] Make translate_phy_pte() static

Second argument pte doesn't need to be a pointer.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
18 years ago[IA64] Cleanup vmx_vcpu.h
Alex Williamson [Thu, 14 Feb 2008 19:20:11 +0000 (12:20 -0700)]
[IA64] Cleanup vmx_vcpu.h

Make fault injection routines static inline for efficiency.
Remove unused definitions.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
18 years ago[IA64] Add support for hvm live migration
Alex Williamson [Thu, 14 Feb 2008 18:50:55 +0000 (11:50 -0700)]
[IA64] Add support for hvm live migration

This is a naive implementation of log dirty mode for HVM.
(I gave up on writing a dirty-bit fault handler in assembler.)

An HVM domain with PV drivers can't be migrated yet.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
18 years agomerge with xen-unstable.hg
Alex Williamson [Thu, 14 Feb 2008 16:34:27 +0000 (09:34 -0700)]
merge with xen-unstable.hg

18 years agox86/64: Make BIOS call to declare our intention to enter long mode.
Keir Fraser [Thu, 14 Feb 2008 11:24:49 +0000 (11:24 +0000)]
x86/64: Make BIOS call to declare our intention to enter long mode.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agox86 iommu: Define vendor-neutral interface for access to IOMMU.
Keir Fraser [Thu, 14 Feb 2008 11:14:17 +0000 (11:14 +0000)]
x86 iommu: Define vendor-neutral interface for access to IOMMU.
Signed-off-by: Wei Wang <wei.wang2@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agoioemu: Support the WMVi pseudoencoding in the vnc server.
Keir Fraser [Thu, 14 Feb 2008 10:36:47 +0000 (10:36 +0000)]
ioemu: Support the WMVi pseudoencoding in the vnc server.

If the client implements it, it is supposed to be able to change
colour depth when receiving a WMVi message.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
18 years agox86 shadow: Reduce scope of shadow lock.
Keir Fraser [Thu, 14 Feb 2008 10:33:12 +0000 (10:33 +0000)]
x86 shadow: Reduce scope of shadow lock.

emulate_map_dest doesn't require holding lock, since
only shadow related operation possibly involved is to
remove shadow which is less frequent and can acquire
lock inside. Rest are either guest table walk or
per-vcpu monitor table manipulation

Signed-off-by Kevin Tian <kevin.tian@intel.com>

18 years agoioemu: Stub out direct-Linux-boot support for anything other than x86.
Keir Fraser [Thu, 14 Feb 2008 10:31:01 +0000 (10:31 +0000)]
ioemu: Stub out direct-Linux-boot support for anything other than x86.
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
18 years agoioemu: backport upstream's qemu_memalign.
Keir Fraser [Thu, 14 Feb 2008 09:26:38 +0000 (09:26 +0000)]
ioemu: backport upstream's qemu_memalign.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
18 years agominios: drop unused xenblk_rxidx function
Keir Fraser [Thu, 14 Feb 2008 09:24:35 +0000 (09:24 +0000)]
minios: drop unused xenblk_rxidx function
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
18 years agostubdom: optimize block io completion polling by not polling all the
Keir Fraser [Thu, 14 Feb 2008 09:23:14 +0000 (09:23 +0000)]
stubdom: optimize block io completion polling by not polling all the
time; only when some requests have completed.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
18 years agoMini-OS: Fix alignment in maybe_split()
Keir Fraser [Thu, 14 Feb 2008 09:22:33 +0000 (09:22 +0000)]
Mini-OS: Fix alignment in maybe_split()
Needed on ia64, speeds up on x86.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
18 years agoxen: Clean up SMP/hotplug headers and implementation a bit.
Keir Fraser [Wed, 13 Feb 2008 18:30:12 +0000 (18:30 +0000)]
xen: Clean up SMP/hotplug headers and implementation a bit.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agovmx realmode: Only check for pending interrupts every 16th
Keir Fraser [Wed, 13 Feb 2008 18:09:27 +0000 (18:09 +0000)]
vmx realmode: Only check for pending interrupts every 16th
instruction, since it is a moderately expensive operation.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years ago[IA64] Cleanup: remove unused functions and definitions
Alex Williamson [Wed, 13 Feb 2008 17:37:18 +0000 (10:37 -0700)]
[IA64] Cleanup: remove unused functions and definitions

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
18 years ago[IA64] Cleanup in xc_ia64_linux_save.c
Alex Williamson [Wed, 13 Feb 2008 17:35:56 +0000 (10:35 -0700)]
[IA64] Cleanup in xc_ia64_linux_save.c

xc_ia64_shadow_control() is not needed any more
since xc_shadow_control() was xencommized.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
18 years ago[IA64] Make xenitp more '|tee' friendly
Alex Williamson [Wed, 13 Feb 2008 17:34:18 +0000 (10:34 -0700)]
[IA64] Make xenitp more '|tee' friendly

Flush stdout after printing the prompt.

Signed-off-by: Tristan Gingold <tgingold@free.fr>
18 years agovmx realmode: __hvm_copy() should not hvm_get_segment_register() when
Keir Fraser [Wed, 13 Feb 2008 16:35:51 +0000 (16:35 +0000)]
vmx realmode: __hvm_copy() should not hvm_get_segment_register() when
we are emulating. Firstly it is bogus, since VMCS segment state is
stale in this context. Secondly, real mode and real->protected
contexts are rather unlikely tohappen with SS.DPL == 3.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agox86 vmx: Streamline vmx_interrupt_blocked() to avoid a VMREAD if
Keir Fraser [Wed, 13 Feb 2008 16:28:38 +0000 (16:28 +0000)]
x86 vmx: Streamline vmx_interrupt_blocked() to avoid a VMREAD if
interrupt delivery is blocked by EFLAGS.IF. This speeds up real-mode
emulation in some cases (where we are currently executing
hvm_local_events_need_delivery() after every instruction).
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agox86 vmx: Remove bogus BUG_ON() introduced in previous changeset.
Keir Fraser [Wed, 13 Feb 2008 16:25:32 +0000 (16:25 +0000)]
x86 vmx: Remove bogus BUG_ON() introduced in previous changeset.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agox86 hvm: Factor out save/restore of segment registers from VMX/SVM
Keir Fraser [Wed, 13 Feb 2008 14:03:58 +0000 (14:03 +0000)]
x86 hvm: Factor out save/restore of segment registers from VMX/SVM
files into common HVM code.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agoTools: fix save/restore of 32-bit PV guests with 64-bit tools
Keir Fraser [Wed, 13 Feb 2008 10:43:13 +0000 (10:43 +0000)]
Tools: fix save/restore of 32-bit PV guests with 64-bit tools
by removing some obvious typos, handling CR3 folding and hvirt_start
based on guest word-size, and understanding 32-bit INVALID_MFN.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
18 years agopv-on-hvm: Signal crash to Xen tools when HVM guest panics.
Keir Fraser [Wed, 13 Feb 2008 10:42:09 +0000 (10:42 +0000)]
pv-on-hvm: Signal crash to Xen tools when HVM guest panics.

Attached patch adds a function to automatically dump core file when
guest linux on HVM domain panics, in the same way as PV domain.

I tested this patch with kernel 2.6.9 and 2.6.18 on both of x86 and
ia64 (to buid for ia64, some patches in the ia64 tree are needed) by
the following steps, and confirmed it works well:

1. Build xen-platform-pci.ko.
2. In /etc/xen/xend-config.sxp, set (enable-dump yes).
3. On guest linux, execute insmod:
   # insmod xen-platform-pci.ko
4. When guest linux panics, a core file is dumped.

Signed-off-by: Tetsu Yamamoto <yamamoto.tetsu@jp.fujitsu.com>
18 years agostubdom: missing two renames (avoids always re-compiling newlib)
Keir Fraser [Tue, 12 Feb 2008 16:59:08 +0000 (16:59 +0000)]
stubdom: missing two renames (avoids always re-compiling newlib)
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
18 years agostubdom: Rename stubdom/*.build into stubdom/*-build, newlib into
Keir Fraser [Tue, 12 Feb 2008 16:46:23 +0000 (16:46 +0000)]
stubdom: Rename stubdom/*.build into stubdom/*-build, newlib into
newlib-cvs, lwip into lwip-cvs.  Fix .hgignore to ignore only them and
not the patches.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
18 years agoMake stubdom/Makefile override XEN_OS to MiniOS, and add
Keir Fraser [Tue, 12 Feb 2008 15:03:07 +0000 (15:03 +0000)]
Make stubdom/Makefile override XEN_OS to MiniOS, and add
config/MiniOS.mk. Add PTHREAD_LIBS to configs (usually holding
-lpthread).

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
18 years ago[BUILD] Disable LOCALVERSION_AUTO in upstream Linux builds.
Keir Fraser [Tue, 12 Feb 2008 14:59:22 +0000 (14:59 +0000)]
[BUILD] Disable LOCALVERSION_AUTO in upstream Linux builds.

If this option is enabled then the Xen mercurial version ID gets
tacked onto the kernel version (e.g. 2.6.24-git22-hg2593b69b183b)
which is unlikely to be useful or desirable. All the trees which we
build using this method already have uniquely identifying versions
(e.g. 2.6.24-git22 or 2.6.24-mm1).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
18 years ago[BUILD] Fixup support for building upstream kernels.
Keir Fraser [Tue, 12 Feb 2008 14:59:01 +0000 (14:59 +0000)]
[BUILD] Fixup support for building upstream kernels.

In particular:
 - support merged x86 architecture. To facilitate this it made sense
   to encode some existing logic in shell scripts rather than
   increasing complicated make conditionals.
 - set CONFIG_PARAVIRT_GUEST=y which is required for newer kernels.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
18 years ago[BUILD] Add option to ensure kernel build is non-interactive.
Keir Fraser [Tue, 12 Feb 2008 14:57:36 +0000 (14:57 +0000)]
[BUILD] Add option to ensure kernel build is non-interactive.

This is useful for the non 2.6.18-xen builds where the defconfig at
any particular momement may require additional questions to be
answered.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
18 years agoAdd stubdomain support. See stubdom/README for usage details.
Keir Fraser [Tue, 12 Feb 2008 14:35:39 +0000 (14:35 +0000)]
Add stubdomain support. See stubdom/README for usage details.

- Move PAGE_SIZE and STACK_SIZE into __PAGE_SIZE and __STACK_SIZE in
  arch_limits.h so as to permit getting them from there without
  pulling all the internal Mini-OS defines.
- Setup a xen-elf cross-compilation environment in stubdom/cross-root
- Add a POSIX layer on top of Mini-OS by linking against the newlib C
  library and lwIP, and implementing the Unixish part in mini-os/lib/sys.c
- Cross-compile zlib and libpci too.
- Add an xs.h-compatible layer on top of Mini-OS' xenbus.
- Cross-compile libxc with an additional xc_minios.c and a few things
  disabled.
- Cross-compile ioemu with an additional block-vbd, but without sound,
  tpm and other details.  A few hacks are needed:
  - Align ide and scsi buffers at least on sector size to permit
  direct transmission to the block backend. While we are at it, just
  page-align it to possibly save a segment. Also, limit the scsi
  buffer size because of limitations of the block paravirtualization
  protocol.
  - Allocate big tables dynamically rather that letting them go to
  bss: when Mini-OS gets installed in memory, bss is not lazily
  allocated, and doing so during Mini-OS is unnecessarily trick while
  we can simply use malloc.
- Had to change the Mini-OS compilation somehow, so as to export
  Mini-OS compilation flags to the Makefiles of libxc and ioemu.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>